import { util } from "utils";
import { Apps } from "../config/application";
import { getPayPlatform } from "../const";

import type { Application } from "../types";
function getPayApplication(platform: string | undefined | null): Application | undefined {
    // 先获取平台
    let thisPlatform = getPayPlatform(platform);
    if (util.nilValue(thisPlatform)) {
        return undefined;
    }
    // 获取 对应的 配置信息
    return Apps[thisPlatform!];
}

export { getPayApplication };
